package com.jewelry.crm.model.dao;

public class Factory {
    private static UserDao userDao = null;
    private static SupplierDao supplierDao = null;
    private static Factory instance = null;

    public static synchronized Factory getInstance(){
        if (instance == null){
            instance = new Factory();
        }
        return instance;
    }


    public UserDao getUserDao(){
        if (userDao == null){
            userDao = new UserDaoImpl();
        }
        return userDao;
    }

    public SupplierDao getSupplierDao() {
        if (supplierDao == null) {
            supplierDao = new SupplierDaoImpl();
        }
        return supplierDao;
    }
}